InBox ZabbixToOTRS
Version 6.3.6
Creation date 05/07/2018
Resources
This module allows the creation of tickets via Zabbix events. It is also possible to recognize a Zabbix event through changes to the ticket in OTRS.
Prerequisites
Framework
The following versions of the OTRS Framework are supported:
- [6.0.x]
The following versions of the Zabbix framework are supported:
- [3.4.x]
modules
The following modules are required:
- InBox Core 6.24.7 or superior
- InBox ZabbixCore 6.3.4 or superior
Operational system
The following operating systems are required:
- [None]
Third Party Software
The following third party software is required:
- [None]
Instalation
bin/otrs.Console.pl Admin::Package::Install /path/to/InBox\ ZabbixToOTRS 6.3.6.opm
Configuration
This module can be configured via "System Configuration" in the administrative interface. The following configuration options are available:
ZabbixUser::UserOTRS
Defines the Zabbix Integration user login in OTRS. The information of the integration user created in the system is found. By default, the user zabbix-integration-user is created (can be changed).
ZabbixUser::PwdOTRS
Sets the password for the Zabbix Integration user in OTRS. The password is randomized in its creation.
AgentTicketFieldsZabbix::DynamicFields
Configuration of the names of the dynamic fields that are filled in when opening the ticket via Zabbix. To be displayed it is necessary to add the name of the field in the configuration.
Use
Module installation
Install the ZabbixToOTRS package. The package will automatically create the following parameters in OTRS:
Dynamic field ZEventID (CANNOT be changed, as it is an internal dynamic field)
Dynamic field ZTriggerStatus (CANNOT be changed, as it is an internal dynamic field)
Dynamic field ZHostName (CANNOT be changed, as it is an internal dynamic field)
Dynamic field ZTriggerID (CANNOT be changed, as it is an internal dynamic field)
Dynamic field ZID (CANNOT be changed, as it is an internal dynamic field)
User zabbix-integration-user
Group zabbix-integration-group
Role zabbix-integration-role
Queue Monitoramento
Generic Attendant zabbix-open-ticket (responsible for leaving the call open when the incident is PROBLEM)
Generic Attendant zabbix-close-ticket (responsible for leaving the call in a closed state when the incident is as OK)
Generic Attendant zabbix-ack-owner (responsible for sending an acknowledgment to zabbix when the owner of the ticket changes)
Webservice ZabbixIntegrator (webservice responsible for integration with zabbix. This name cannot be changed)
The generic attendant zabbix-ack-owner uses the queue created as Monitoramento by default. If another queue is created to open Zabbix tickets, this generic attendant must be changed to the new queue. The generic attendant zabbix-ack-owner uses a custom module called Kernel::System::GenericAgent::ZabbixAcknowledge. This module can be used for any acknowledgment send to zabbix, which uses the parameters set in the generic attendant.
Uploading the integration script to the Zabbix server
For the integration to take place, you will need to create some files on the zabbix server.
1 - Create a folder called otrs in /path/to/alertscripts/ 2 - Request the files from the repository zabbix_to_otrs_PHP for Service Up. 3 - Paste the files into the folder otrs.
Exemple:
Configuration
Configure integration script on the Zabbix server
Inside of path/to/alertscripts/otrs/config copy the serviceup folder which has an example configuration file to an OTRS server. Within this folder, access config.php and change the respective settings for the opening of the ticket in this OTRS. For each OTRS that Zabbix communicates, there must be a folder with a config.php file with the opening data.
Copy to folder serviceup and configure the ticket opening settings. (if there is another type of ticket opening configuration, that is, another queue or another OTRS server, there must be another configuration folder).
OTRS settings: $HOST = Server where otrs is communicating $QUEUE = Opening queue for zabbix tickets (Monitoring the standard creation of the ZabbixToOTRS package for OTRS) $TYPE = Open ticket type by zabbix $STATE = Initial opening state of the ticket $LOCK = Initial ticket block $ZBX_USR_LOGIN = Zabbix integration user in OTRS (zabbixintegration-user for the default user created by the package) $ZBX_USR_PASS = Password set by default when installing the package $ZBX_USR_EMAIL = Email of the zabbix integration user (zabbix@exemple.com.br by default) $ZBX_ID = Host ID of the zabbix opening the ticket (mapped to OTRS in the ZabbixCore host configuration) $ZBXSERVER = Zabbix server that is performing the integration
Create execution action
Copy the following text into a notepad:
"--configFolder=DIRECTORY --triggerID={TRIGGER.ID} --eventID={EVENT.ID} --hostName={HOST.NAME1} --customer=CLIENTE --hostIP={HOST.IP1} --clientVisible={TRIGGER.HOSTGROUP.NAME} --description={TRIGGER.NAME} --priorityID={TRIGGER.NSEVERITY} --priorityName={TRIGGER.SEVERITY} --Value={ITEM.VALUE1} --statusName={TRIGGER.STATUS}"
replace DIRECTORY with the OTRS configuration directory described in the previous step. The directory must be relative to path/to/alertscripts/otrs/config. Also replace CLIENT with the client user configured in the OTRS for the action that will be performed.
When filling in the information, copy the text from the notepad and paste it into the action message at “operation” and “recovery operations” on zabbix.
Note: Configure a media type for integration, so the message will be sent in the action.
Adding new parameters at the opening of the ticket
If you want to add new parameters at the opening, you will need to add the new information in the action message respecting the following structure:
--Key=Value
To enter Zabbix values, you must pass the keys for the value. Example: {TRIGGER.ID} Example:
--NameKey=Test
The message will look like this:
"--configFolder=serviceup --triggerID={TRIGGER.ID} --eventID={EVENT.ID} --hostName={HOST.NAME1} --customer=zabbix-integration-user --hostIP={HOST.IP1} --clientVisible={TRIGGER.HOSTGROUP.NAME} --description={TRIGGER.NAME} --priorityID={TRIGGER.NSEVERITY} --priorityName={TRIGGER.SEVERITY} --Value={ITEM.VALUE1} --statusName={TRIGGER.STATUS} --NameKey=Test"
Then, the excerpt referring to the new value must be added in the message in the file openTicket.php
[
'Name' => 'DynamicFieldNameOTRS',
'Value' => $GLOBALS["NameKey"]
],
In the "Name" parameter, the name of the dynamic field must be informed in the OTRS. In the "Value" Parameter, the name of the key informed in the message configured above must be informed.
If it is necessary to inform another field, the procedure must be repeated.